how to make function in javascript